package com.zy.mall.service.impl;

import com.zy.mall.dao.IndexImgDAO;
import com.zy.mall.entity.IndexImg;
import com.zy.mall.service.IndexImgService;
import com.zy.mall.po.ResStatus;
import com.zy.mall.po.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class IndexImgServiceImpl implements IndexImgService {

    @Autowired
    private IndexImgDAO indexImgDAO;

    public ResultVo listIndexImgs() {
        List<IndexImg> indexImgs = indexImgDAO.listIndexImgs();
        if(indexImgs.size() == 0){
            return new ResultVo(ResStatus.NO,"fail",null);
        }else{
            return new ResultVo(ResStatus.OK,"success",indexImgs);
        }
    }
}
